package com.bto.solar.work.dto;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.bto.solar.work.entity.Department;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.sql.Timestamp;
import java.util.List;

/**
 * <p>
 * 部门表
 * </p>
 *
 * @author shiyi
 * @since 2023-08-14
 */
@Getter
@Setter
@Data
@Accessors(chain = true)
@ApiModel(value = "Department对象", description = "部门表")
public class DepartmentRes {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("部门ID")
    @TableId(value = "department_id", type = IdType.AUTO)
    private Long departmentId;

    @ApiModelProperty("部门名称")
    private String name;

    @ApiModelProperty("公司ID")
    private Long companyId;

    @ApiModelProperty("部门负责人")
    private Long leader;

    @ApiModelProperty("上极部门ID")
    private Long parentId;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Timestamp createTime;

    @ApiModelProperty("更改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Timestamp updateTime;

    @ApiModelProperty("下级部门")
    private List<DepartmentRes> departmentRes;

}
